/*******************************************************************************
*  Project      : Minigate Golfin                                 
*  Program ID   : club_create.js                                 
*  Description  : 클럽생성
*
********************************************************************************
*  Program History                                                            
*  Date        Author    Description                                          
*  ----------  --------  -------------------------------------------------------- 
*  2012-04-19  김효순    Created.   
*  2012-04-19  김효순    Complete.  
*******************************************************************************/

jQuery(function($){
		
	// 동호회 이름
	function clsClubName()
	{
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOVALUE": "동호회 이름을 입력해 주십시요."
			, "_INVALID": "동호회 이름은 2~20자 이내로 입력해 주십시요."
			, "_DUPLICATE": "중복확인을 하십시요."
		}
		this._clubData = {
			"클럽명": null
			, "중복유무": null
		}
		this.errMsg = null;
		this._init();
	}
	
	clsClubName.prototype = {
		_init: function(){
			this._HTMLDom = {
				"$layer": $("div#container section#main_content input:text:eq(0)")
			}
		}
		, getValue: function(){
			return this._HTMLDom["$layer"].val();
		}
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var val = $layer.val();
			var reg = /^.{2,20}$/ig;
			
			if(val.length == 0){
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}else if(!reg.test(val)){
				this.errMsg = this._ERRMSG["_INVALID"];
				return false;
			}else if(!this._clubData["중복유무"]){
				
				this.errMsg = this._ERRMSG["_DUPLICATE"];
				return false;
			}
			
			return true;
		}
		, getError: function(){
			return this.errMsg;
		}
		, focus: function(){
			this._HTMLDom["$layer"].trigger("focus");
		}
		, $getBtnDuplicate: function(){
			return 	this._HTMLDom["$layer"].parent().find("a");
		} 
		, setClubData: function(key,val){
			this._clubData[key] = val;
		}
	}
	
	// 동호회 소개
	function clsClubIntro()
	{
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOVALUE": "동호회 소개를 입력해 주십시요."
			, "_INVALIDLEN": "동호회 소개는 40자 이내로 입력해 주십시요."
			
		}
		this.errMsg = null;
		this._init();
	}
	
	clsClubIntro.prototype = {
		_init: function(){
			this._HTMLDom = {
				"$layer": $("div#container section#main_content input:text:eq(1)")
			}
		}
		, getValue: function(){
			return this._HTMLDom["$layer"].val();
		}
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var val = $layer.val();
			var regLen = /^.{2,40}$/ig;
						
			
			if(val.length == 0){
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}else if(!regLen.test(val)){
				this.errMsg = this._ERRMSG["_INVALIDLEN"];
				return false;
			}
			
			return true;
		}
		, getError: function(){
			return this.errMsg;
		}
		, focus: function(){
			this._HTMLDom["$layer"].trigger("focus");
		}
	}
	
	// 승인여부
	function clsApproval()
	{
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOVALUE": "승인여부를 선택해 주십시요."
			,"_NOCOMMENT":"가입 질문을 입력하여 주세요."
			,"_INVALIDLEN":"30자 이내로 입력하여 주세요."
		}
		this.errMsg = null;
		this._init();
	}
	
	clsApproval.prototype = {
		_init: function(){
			var thisClass = this;
			var $layer = $("div#container section#main_content tr:eq(2) input:radio"); 
			var $comment = $("div#container section#main_content tr:eq(2) input:text")
			this._HTMLDom = {
				"$layer": $layer
				, "$comment": $comment
			}
			
			$layer.each(function(n){
				$(this).attr("name", "rdoApproval");
			});
			
			$layer.click(function(event){
				var idx = $layer.index($layer.filter(":checked"));
				$comment.prop("readonly",(idx?false:true));				
			});
		}
		, getValue: function(){
			return this._HTMLDom["$layer"].eq(0).is(":checked");
		}
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var $comment = this._HTMLDom["$comment"];
			var val = this.getValue();
			var regLen = /^.{0,30}$/ig;
			
			var idx = $layer.index($layer.filter(":checked"));
			
			if($layer.filter(":checked").length == 0){
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}else if(!regLen.test($comment.val())){
				this.errMsg = this._ERRMSG["_INVALIDLEN"];
				return false;
			}else if(idx){
				if($comment.val().length == 0){
					this.errMsg = this._ERRMSG["_NOCOMMENT"];
					return false;
				}
			}
			
			return true;
		}
		, getError: function(){
			return this.errMsg;
		}
		, focus: function(){
			this._HTMLDom["$layer"].eq(0).trigger("focus");
		}
		, getComment: function(){
			return this._HTMLDom["$comment"].val();
		}
	}
	
	//키워드
	function clsKeyword(){
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOKEYWORD1": "키워드 1번항목을 입력해 주십시요."
			, "_NOKEYWORD2": "키워드 2번항목을 입력해 주십시요."
			, "_NOKEYWORD3": "키워드 3번항목을 입력해 주십시요."
			, "_INVALIDEXP1": "키워드 1번에 특수문자가 입력되었습니다."
			, "_INVALIDEXP2": "키워드 2번에 특수문자가 입력되었습니다."
			, "_INVALIDEXP3": "키워드 3번에 특수문자가 입력되었습니다."
			, "_FOCUS": ""
		}
		this.errMsg = null;
		this._init();
	}
	
	clsKeyword.prototype = {
		_init: function(){
			this._HTMLDom = {
				"$layer": $("div#container section#main_content tr:eq(3) input:text")
			}
		}	
		, getValue: function(){
			var result  = "";
			
			for(var i=0;i<this._HTMLDom["$layer"].length;++i){
				if(result != "") result += ",";
				result += this._HTMLDom["$layer"][i].value;
			}
			
			return result;
		}
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var val = this.getValue().split(",");
			var regLen = /^.{2,20}$/ig;
			var regExp1 = /[ㄱ-ㅎㅏ-ㅣ가-힣A-Za-z0-9]$/ig;
			var regExp2 = /[ㄱ-ㅎㅏ-ㅣ가-힣A-Za-z0-9]$/ig;
			var regExp3 = /[ㄱ-ㅎㅏ-ㅣ가-힣A-Za-z0-9]$/ig;
			
			if($layer.eq(0).val().length == 0) {
				this.errMsg =  this._ERRMSG["_NOKEYWORD1"];
				this._ERRMSG["_FOCUS"] = 0;
				return false;
			}else if(!regExp1.test($layer.eq(0).val())){
				this.errMsg = this._ERRMSG["_INVALIDEXP1"];
				this._ERRMSG["_FOCUS"] = 0;
				return false;
			}else if($layer.eq(1).val().length == 0) {
				this.errMsg =  this._ERRMSG["_NOKEYWORD2"];
				this._ERRMSG["_FOCUS"] = 1;
				return false;
			}else if(!regExp2.test($layer.eq(1).val())){
				this.errMsg = this._ERRMSG["_INVALIDEXP2"];
				this._ERRMSG["_FOCUS"] = 1;
				return false;
			}else if($layer.eq(2).val().length == 0) {
				this.errMsg =  this._ERRMSG["_NOKEYWORD3"];
				this._ERRMSG["_FOCUS"] = 2;
				return false;
			}else if(!regExp3.test($layer.eq(2).val())){
				this.errMsg = this._ERRMSG["_INVALIDEXP3"];
				this._ERRMSG["_FOCUS"] = 2;
				return false;
			}
			
			return true;	
		}
		, getError: function(){
			return this.errMsg;
		}
		, focus: function(){
			var $layer = this._HTMLDom["$layer"];
			var n = this._ERRMSG["_FOCUS"];
			
			this._HTMLDom["$layer"].eq(n).trigger("focus");
		}
	}
	
	// 카테고리
	function clsCategory()
	{
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOVALUE": "카테고리를 선택해 주십시요."
		}
		this._RDOValue = [
			"1", "2", "3", "4", "5"
		];
		this.errMsg = null;
		this._init();
	}
	
	clsCategory.prototype = {
		_init: function(){
			var thisClass = this;
			
			this._HTMLDom = {
				"$layer": $("div#container section#main_content tr:eq(4) :radio")
			}
			
			this._HTMLDom["$layer"].each(function(n){
				$(this).attr("name", "rdoCategory").val(thisClass._RDOValue[n]);
			});
		}
		, getValue: function(){
			return this._HTMLDom["$layer"].filter(":checked").val();
		}
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var val = this.getValue();
			
			if(!val){
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}
			
			return true;
		}
		, getError: function(){
			return this.errMsg;
		}
		, focus: function(){
			this._HTMLDom["$layer"].eq(0).trigger("focus");
		}
	}
	
	// 상단스킨
	function clsSkin()
	{
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOVALUE": "상단스킨을 선택해 주십시요."
			, "_NOIMAGE": "이미지를 직접 등록해 주십시요."
		}
		this.errMsg = null;
		this._FILE = {
			 "파일키": null
			, "섬네일": null
			, "파일명": null
			, "원본파일명": null
		}
		
		this._init();
	}
	
	clsSkin.prototype = {
		_init: function(){
			var thisClass = this;
			
			this._HTMLDom = {
				"$layer": $("div#container section#main_content tr:eq(6)")   
			}
			
			_gf.setUploadFileImage(this.$getBtnSubmit(), null, function(ret){
				thisClass.setCustomImgUrl(ret["파일리스트"][0]);
			});
			
			// 라디오버튼 value값 설정
			this._HTMLDom["$layer"].find("input:radio").each(function(n){
				var $img = $(this).parent().next("img");
				var src = $img.attr("src");
				
				if(n == 0){
					$(this).attr("name", "rdoSkin").val("").click(function(event){
						var val = thisClass.getValue();
						
						if(!val) thisClass.$getBtnSubmit().trigger("click");
					});
				}else{
					$(this).attr("name", "rdoSkin").val(src).click(function(event){
						thisClass._FILE["선택파일"] = src;
					});
				}
			});
		}
		, getValue: function(){
			var $layer = this._HTMLDom["$layer"];
			var idx = $layer.find("input:radio").index($layer.find("input:radio:checked"));
			if(idx){
				return $layer.find("p>img").eq(idx).attr("src");
			}else {				
				return "NOT,NOT," + this._FILE["파일명"] + "," + this._FILE["원본파일명"];
			}
		}				
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var val = this.getValue();;
			
			if(this.getIdx()<0 ) {
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}else if(this.getIdx()==0 && !this._FILE["파일명"]){
				this.errMsg = this._ERRMSG["_NOIMAGE"];
				return false;
			}else if(this.getIdx()>0 && !this._FILE["선택파일"]){
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}
								
			return true;
		}
		, getError: function(){
			return this.errMsg;
		}
		, $getBtnSubmit: function(){
			return this._HTMLDom["$layer"].find("span.ma_left5 a img");
		}
		, focus: function(){
			this._HTMLDom["$layer"].filter("input:radio:first").trigger("focus");
		}
		// 파일전송 완료 후
		, setCustomImgUrl: function(ret){
			this._FILE = ret;
			
			var imgUrl = _gf.filePath2Url(ret["파일명"]);
			
			this._HTMLDom["$layer"].find("input:radio").eq(0).prop("checked",true);
			this._HTMLDom["$layer"].find("img:eq(1)").eq(0).attr({
				"src": imgUrl
				, "width": 400
				, "height": 70
			});
			_gf.spinEnd();
		}
		, getIdx: function(){
			return this._HTMLDom["$layer"].find("input:radio").index(this._HTMLDom["$layer"].find("input:radio").filter(":checked"));
		}
	}
	
	// 배너이미지
	function clsBanner()
	{
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOVALUE": "배너를 선택해 주십시요."
			, "_NOIMAGE": "배너 이미지를 직접 등록해 주십시요."
		}
		this.errMsg = null;
		this._FILE = {
			 "파일키": null
			, "섬네일": null
			, "파일명": null
			, "원본파일명": null
		}
		
		this._init();
	}
	
	clsBanner.prototype = {
		_init: function(){
			var thisClass = this;
					
			this._HTMLDom = {
				"$layer": $("div#container section#main_content tr:eq(7)")
			}
			
			_gf.setUploadFileImage(this.$getBtnSubmit(), null, function(ret){
				thisClass.setCustomImgUrl(ret["파일리스트"][0]);
			});
			
			// 라디오버튼 value값 설정
			this._HTMLDom["$layer"].find("input:radio").each(function(n){
				var $img = $(this).parent().next();
				var src = $img.attr("src");
				
				if(n == 0){
					$(this).attr("name", "rdoBanner").val("").click(function(event){
						var val = thisClass.getValue();
						
						if($.browser.msie && !val){
							alert("파일을 직접 등록해 주십시요.");
						}else{
							if(!val) thisClass.$getBtnSubmit().trigger("click");
						}
					});
				}else{
					$(this).attr("name", "rdoBanner").val(src).click(function(event){
						thisClass._FILE["선택파일"] = src;
					});
				}
			});			
		}
		, getValue: function(){
			var $layer = this._HTMLDom["$layer"];
			var idx = $layer.find("input:radio").index($layer.find("input:radio:checked"));
			if(idx){			
				return $layer.find("p>img").eq(idx).attr("src");
			}else {
				return "NOT,NOT," + this._FILE["파일명"] + "," + this._FILE["원본파일명"];
			}
		}				
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var val = this.getValue();;
			
			if(this.getIdx()<0 ) {
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}else if(this.getIdx()==0 && !this._FILE["파일명"]){
				this.errMsg = this._ERRMSG["_NOIMAGE"];
				return false;
			}else if(this.getIdx()>0 && !this._FILE["선택파일"]){
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}
								
			return true;
		}
		, getError: function(){
			return this.errMsg;
		}
		, $getBtnSubmit: function(){
			return this._HTMLDom["$layer"].find("span.ma_left5 a>img");
		}
		, focus: function(){
			this._HTMLDom["$layer"].filter("input:radio:first").trigger("focus");
		}
		// 파일전송 완료 후
		, setCustomImgUrl: function(ret){
			this._FILE = ret;
			
			var imgUrl = _gf.filePath2Url(ret["파일명"]);
			
			this._HTMLDom["$layer"].find("input:radio").eq(0).prop("checked",true);
			this._HTMLDom["$layer"].find("img:eq(1)").eq(0).attr({
				"src": imgUrl
				, "width": 225
      			, "height": 70
			});
			_gf.spinEnd();			
		}
		, getIdx: function(){
			return this._HTMLDom["$layer"].find("input:radio").index(this._HTMLDom["$layer"].find("input:radio").filter(":checked"));
		}
	}
	
	//로고이미지
	function clsLogo()
	{
		this._HTMLDom = null;
		this._ERRMSG = {
			"_NOVALUE": "배너를 선택해 주십시요."
			, "_NOIMAGE": "배너 이미지를 직접 등록해 주십시요."
		}
		this.errMsg = null;
		this._FILE = {
			 "파일키": null
			, "섬네일": null
			, "파일명": null
			, "원본파일명": null
		}
		
		this._init();
	}
	
	clsLogo.prototype = {
		_init: function(){
			var thisClass = this;
					
			this._HTMLDom = {
				"$layer": $("div#container section#main_content tr:eq(8)")
			}
			
			_gf.setUploadFileImage(this.$getBtnSubmit(), null, function(ret){
				thisClass.setCustomImgUrl(ret["파일리스트"][0]);
			});
			
			// 라디오버튼 value값 설정
			this._HTMLDom["$layer"].find("input:radio").each(function(n){
				var $img = $(this).parent().next();
				var src = $img.attr("src");
				
				if(n == 0){
					$(this).attr("name", "rdoLogo").val("").click(function(event){
						var val = thisClass.getValue();
						
						if($.browser.msie && !val){
							alert("파일을 직접 등록해 주십시요.");
						}else{
							if(!val) thisClass.$getBtnSubmit().trigger("click");
						}
					});
				}else{
					$(this).attr("name", "rdoLogo").val(src).click(function(event){
						thisClass._FILE["선택파일"] = src;
					});
				}
			});			
		}
		, getValue: function(){
			var $layer = this._HTMLDom["$layer"];			
			var idx = $layer.find("input:radio").index($layer.find("input:radio:checked"));
			if(idx){			
				return $layer.find("img").eq(idx+1).attr("src");
			}else {
				return "NOT,NOT," + this._FILE["파일명"] + "," + this._FILE["원본파일명"];
			}
		}				
		, isValid: function(){
			var $layer = this._HTMLDom["$layer"];
			var val = this.getValue();;
			
			if(this.getIdx()<0 ) {
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}else if(this.getIdx()==0 && !this._FILE["파일명"]){
				this.errMsg = this._ERRMSG["_NOIMAGE"];
				return false;
			}else if(this.getIdx()>0 && !this._FILE["선택파일"]){
				this.errMsg = this._ERRMSG["_NOVALUE"];
				return false;
			}
								
			return true;
		}
		, getError: function(){
			return this.errMsg;
		}
		, $getBtnSubmit: function(){
			return this._HTMLDom["$layer"].find("span.ma_left5 a>img");
		}
		, focus: function(){
			this._HTMLDom["$layer"].filter("input:radio:first").trigger("focus");
		}
		// 파일전송 완료 후
		, setCustomImgUrl: function(ret){
			this._FILE = ret;
			
			var imgUrl = _gf.filePath2Url(ret["파일명"]);
			
			this._HTMLDom["$layer"].find("input:radio").eq(0).prop("checked",true);
			this._HTMLDom["$layer"].find("img:eq(1)").eq(0).attr({
				"src": imgUrl
				, "width": 50
      			, "height": 50
			});
			_gf.spinEnd();			
		}
		, getIdx: function(){
			return this._HTMLDom["$layer"].find("input:radio").index(this._HTMLDom["$layer"].find("input:radio").filter(":checked"));
		}
	}
	
	function clsComm()
	{
		this.clubNameRequest = null;
		this._init();
	}
	
	clsComm.prototype = {
		_init: function(){
			this.clubNameRequest = {
				"클럽명": null
			}	
		}
		, clubNameDuplicate: function(){
			var thisClass = this;
			
			// ajax 시작			
			//parameter setting and run
			_gf.ajax({
				"sid":"CL001",
				"servicename":"checkClubName"
			}, {
				"clubName": this.clubNameRequest["클럽명"]				
			}, function(ret){
				
				// callback and mapping
				var resData = {
					"성공여부": (ret["msp"]["contents"]["serviceResult"] == "00000"?true:false)
					, "리턴메시지": _gf.getResultMsg(ret)
					, "클럽명" : thisClass.clubNameRequest["클럽명"]
				}
				
				$(thisClass).trigger("evtFinishClubNameDuplicate", [resData]);
			});
			// ajax 끝			
		}
		, setClubNameRequest: function(key, val){
			this.clubNameRequest[key] = val;	
		}
		, clubSubmit: function(arg){
			var thisClass = this;
			
			// ajax 시작			
			//parameter setting and run
			_gf.ajax({
				"sid":"CL001",
				"servicename":"regist"
			}, {
				"clubName": arg["동호회이름"]
				, "clubDesc": arg["동호회소개"]
				, "acceptYn": arg["가입승인여부"]
				, "acceptQuestion": arg["가입승인질문"]
				, "clubKeyword": arg["키워드"]
				, "categoryId": arg["카테고리"]
				, "skinUrl": arg["상단스킨"]
				, "skinGb": arg["상단스킨구분"]
				, "bannerUrl": arg["배너이미지"]
				, "bannerGb": arg["배너이미지구분"]
				, "logoUrl": arg["로고이미지"]
				, "logoGb": arg["로고이미지구분"]
				
			}, function(ret){
				
				// callback and mapping
				var resData = {
					"응답코드": (ret["msp"]["contents"]["serviceResult"] == "00000"?true:false)
					, "메세지": _gf.getResultMsg(ret)
					, "동호회키": ret["msp"]["contents"]["items"]["clubSeq"]
				}
				
				$(thisClass).trigger("evtFinishClubSubmit", [resData]);
			});
			// ajax 끝						
		}
		
		// 파일전송
		, fileSubmit: function(arg){			
			var thisClass = this;
			
			// ajax.fileUpdate		
			szThumb = arg["섬네일"];
			
			// ajax.fileUpdate 시작
			_gf.uploadFile(arg["섬네일"], function(ret){
					var $code = ret["결과코드"];
					var $fileName = ret["파일리스트"][0]["파일명"]; 
					var $orgFileName = ret["파일리스트"][0]["원본파일명"];
					var $fileSize = ret["파일리스트"][0]["파일크기"];
					var $thumbFileName = ret["파일리스트"][0]["섬네일"];
					
					arg.f({
						 "파일키": "NOT"
						, "섬네일": ret["파일리스트"][0]["섬네일"]
						, "파일명": ret["파일리스트"][0]["파일명"]						
						, "원본파일명": ret["파일리스트"][0]["원본파일명"]
					});
			});
			// ajax.fileUpdate 끝
			
		}
	}
	
	// 컨트롤
	function clsControl()
	{
		this.objComm = null;
		this.objClubName = null;
		this.objClubIntro = null;
		this.objApproval = null;
		this.objKeyword = null;
		this.objCategory = null;
		this.objSkin = null;
		this.objBanner = null;
		this.objLogo = null;
		
		this._init();
	}
	
	clsControl.prototype = {
		_init: function(){
			this.objComm = new clsComm();
			this.objClubName = new clsClubName();
			this.objClubIntro = new clsClubIntro();
			this.objApproval = new clsApproval();
			this.objKeyword = new clsKeyword();
			this.objCategory = new clsCategory();
			this.objSkin = new clsSkin();
			this.objBanner = new clsBanner();
			this.objLogo = new clsLogo();
			
			this._bind();
		}
		, _bind: function(){
			var thisClass = this;
					
			//동호회명 중복확인 완료이벤트
			$(this.objComm).bind("evtFinishClubNameDuplicate", function(event, retData){
				_gf.spinEnd();
				
				alert(retData["리턴메시지"]);					
				
				if(retData["성공여부"]) {
					thisClass.objClubName.setClubData("클럽명",retData["클럽명"]);
					thisClass.objClubName.setClubData("중복유무",true);
					
				}else{
					thisClass.objClubName.setClubData("중복유무",false);
					thisClass.objClubName.focus();					
					
				}
								
			});	
				
			// 동호회 개설 전송 완료
			$(this.objComm).bind("evtFinishClubSubmit", function(event, retData){
				_gf.spinEnd();
				
				alert(retData["메세지"]);
				
				if(retData["응답코드"]){
					document.location.href = "../self_club/home.html?club_seq=" + retData["동호회키"];	
				}
				
			});
			
			//동회회이름 중복확인 이벤트
			this.objClubName.$getBtnDuplicate().click(function(event){
				var clubName = thisClass.objClubName.getValue();
				
				thisClass.objClubName.setClubData("클럽명",clubName);
				thisClass.objComm.setClubNameRequest("클럽명",clubName);
				thisClass.objComm.clubNameDuplicate();
			});
			
			// 확인			
			$("div#container section#main_content p a img[alt=확인]").click(function(event){
				event.preventDefault();
						
				var clubName = thisClass.objClubName.getValue();
				var clubIntro = thisClass.objClubIntro.getValue();
				var approval = (thisClass.objApproval.getValue()?"N":"Y");
				var approvalComment = thisClass.objApproval.getComment();
				var keyword = thisClass.objKeyword.getValue();
				var category = thisClass.objCategory.getValue();
				var skin = thisClass.objSkin.getValue();
				var skinGb = thisClass.objSkin.getIdx();
				var banner = thisClass.objBanner.getValue();
				var bannerGb = thisClass.objBanner.getIdx();
				var logo = thisClass.objLogo.getValue();
				var logoGb = thisClass.objLogo.getIdx();
								
				if(!thisClass.objClubName.isValid()){
					alert(thisClass.objClubName.getError());
					thisClass.objClubName.focus();
					return;
				}else if(!thisClass.objClubIntro.isValid()){
					alert(thisClass.objClubIntro.getError());
					thisClass.objClubIntro.focus();
					return;
				}else if(!thisClass.objApproval.isValid()){
					alert(thisClass.objApproval.getError());
					thisClass.objApproval.focus();
					return;
				}else if(!thisClass.objKeyword.isValid()){
					alert(thisClass.objKeyword.getError());
					thisClass.objKeyword.focus();
					return;
				}else if(!thisClass.objCategory.isValid()){
					alert(thisClass.objCategory.getError());
					thisClass.objCategory.focus();
					return;
				}else if(!thisClass.objSkin.isValid()){
					alert(thisClass.objSkin.getError());
					thisClass.objSkin.focus();
					return;
				}else if(!thisClass.objBanner.isValid()){
					alert(thisClass.objBanner.getError());
					thisClass.objBanner.focus();
					return;
				}else if(!thisClass.objLogo.isValid()){
					alert(thisClass.objLogo.getError());
					thisClass.objLogo.focus();
					return;
				}
				
				_gf.spinStart();
				
				thisClass.objComm.clubSubmit({
																		"동호회이름": clubName
																	,"동호회소개": clubIntro
																	,"가입승인여부": approval
																	,"가입승인질문": approvalComment
																	,"키워드": keyword
																	,"카테고리": category
																	,"상단스킨": skin
																	,"상단스킨구분": skinGb
																	,"배너이미지": banner
																	,"배너이미지구분": bannerGb
																	, "로고이미지": logo
																	, "로고이미지구분": logoGb
																	});
			});
		}
	}
	
	document.objControl = new clsControl();
});